//
//  DHNormalCell.m
//  精品酒店
//
//  Created by DIANGHONG on 2018/5/8.
//  Copyright © 2018年 DIANGHONG. All rights reserved.
//

#import "DHNormalCell.h"
@interface DHNormalCell()
@property (weak, nonatomic) IBOutlet UIImageView *hotelImageView;
@property (weak, nonatomic) IBOutlet UILabel *isCheckout;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@property (weak, nonatomic) IBOutlet UIButton *detailButton;
@property (weak, nonatomic) IBOutlet UIButton *preOrderButton;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *addressLabel;
@property (weak, nonatomic) IBOutlet UILabel *distanceLabel;


@end
@implementation DHNormalCell

- (void)setModel:(DHOrderModel *)model{
    _model = model;
    
    [self.hotelImageView sd_setImageWithURL:[NSURL URLWithString:model.logo]];
    self.timeLabel.text = model.end_time;
    self.priceLabel.text = model.price;
    self.distanceLabel.text = [NSString stringWithFormat:@"%.02fkm",model.distance.floatValue / 1000];
    self.addressLabel.text = model.address;

}

- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self.detailButton addTarget:self action:@selector(detailButtonClick) forControlEvents:UIControlEventTouchUpInside];
    [self.preOrderButton addTarget:self action:@selector(preOrderButtonClick) forControlEvents:UIControlEventTouchUpInside];


}

#pragma mark: - detailButton监听
- (void)detailButtonClick{
    [self.delegate normalCell:self detailButtonClickWithModel:self.model];
}
#pragma mark: - preOrderButton监听
- (void)preOrderButtonClick{
    [self.delegate normalCell:self preOrderButtonClickWithModel:@"未实现"];
}
@end
